﻿using System;
using System.Collections.Generic;
using System.Linq;
using SampleData;

namespace Central.Linq.Mvc.Demo.Models {

	public class IndexPageViewModel : PreparableViewModel<Person, PersonViewModel> {

		public IndexPageViewModel(IList<FilterDefinition> filters)
			: base(filters) {
			if (filters == null) throw new ArgumentNullException("filters", "Список фильтров пустой!");
		}

		public IndexPageViewModel(IList<FilterDefinition> filters, int? pageindex, IQueryable<Person> items)
			: base(filters, pageindex, items) {
			base.MakeSelection(pageindex, items);
		}

		protected override InfoManager InitializeInfoManager() {
			return new PersonInfoManager();
		}
	}
}